package FMainController;

import java.io.IOException;
import org.json.simple.*; 
import java.io.PrintWriter;
import java.util.*;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;

import CommunityController.BCBoardDAO;
import CommunityController.FreeBoardDAO;
import PhotoController.PhotoYoungDAO;


public class MOldAction extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
  
    public MOldAction() {
        super();
    
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		System.out.println("!!!집에 가자!!!");
		request.setCharacterEncoding("UTF-8");
 		response.setCharacterEncoding("UTF-8");
 		response.setContentType("text/html; charset=UTF-8");
 		RequestDispatcher view = null;
 		
 		PhotoYoungDAO photoYoungDAO=new PhotoYoungDAO();
		
 		BCBoardDAO bCBoardDAO=new BCBoardDAO();
		
 		FreeBoardDAO freeBoardDAO=new FreeBoardDAO();
		
 		ArrayList list=photoYoungDAO.pt_young_list_main();
		
 		ArrayList list2=freeBoardDAO.cm_free_list_main();
		
 		ArrayList list3=bCBoardDAO.cm_bc_list_main();
 		
 		request.setAttribute("list",list);
 		request.setAttribute("list2",list2);
 		request.setAttribute("list3",list3);
 		view = request.getRequestDispatcher("/Main/OldMain/Om_Main.jsp");
		view.forward(request, response);
 		
	}
}